package cn.tianyun.pethome.org.service.impl;

import cn.tianyun.pethome.basic.util.PageList;
import cn.tianyun.pethome.org.domain.Detail;
import cn.tianyun.pethome.org.mapper.DetailMapper;
import cn.tianyun.pethome.org.query.DepartmentQuery;
import cn.tianyun.pethome.org.service.IDetilService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DetailServiceImpl implements IDetilService {
   @Autowired
   private DetailMapper detailMapper;
    @Override
    public PageList<Detail> loadById(DepartmentQuery query) {
       List<Detail> data= detailMapper.queryData(query);
       Long total= detailMapper.queryCount(query);
        PageList<Detail> detailPageList = new PageList<>(data, total);
        return detailPageList;
    }

    @Override
    public void add(Detail detail) {
        System.out.println("fasfjghajghj d");
        detailMapper.add(detail);
    }
    @Override
    public void update(Detail detail) {
        detailMapper.update(detail);
    }

    @Override
    public void delete(Long id) {
        detailMapper.deleteById(id);
    }
}

